package cn.wolfcode.crm.query;

import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

//封装分页查询对象
@Getter
@Setter
public class QueryObject {
    private int currentPage = 1; //当前页
    private int pageSize = 3; //每页显示条数
    //计算开始的索引
    public int getStart(){
        return (currentPage - 1) * pageSize;
    }

    private String keyword;//关键字
    public String getKeyword(){
        return StringUtils.hasLength(keyword) ? keyword.trim() : null;
    }
}
